# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=razor
_realname=razor-agents
pkgver=2.85
pkgrel=15
pkgdesc="Vipul's Razor is a distributed, collaborative spam detection and filtering network"
url="https://razor.sourceforge.net/"
arch="all"
license="Artistic-2.0"
depends="perl perl-digest-sha1 perl-getopt-long perl-uri"
makedepends="perl-dev"
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/razor/razor-agents/$_realname-$pkgver.tar.bz2
	fix-cosmetic-pv.patch
	fix-manpage-quoting.patch
	"
builddir="$srcdir/$_realname-$pkgver"

prepare() {
	default_prepare

	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make -j1
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

check() {
	make test
}

sha512sums="31dded1969dde963389a5939514c29638ad07f45dbb2f4c633cf20ebc4abab94e65e9a6d8885233cdde686ef365aab11fa5eba2ca38d79c5b8fab689143ff5db  razor-agents-2.85.tar.bz2
75c18cbf22172657976eb3140e736134115c072be46c5165326237f73af592afbe49229058d9c80f8a99f486cae075e16b36822b73f194034b20e83afee382ec  fix-cosmetic-pv.patch
25b5449f4b13d3c8373ed3bb67970c187d7ea3235a6e4f0baf60618004addc124321b36bf0a4c320b5b7370498c857c6477bfecb1658e441e0edacde149d361e  fix-manpage-quoting.patch"
